import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar '),
        ),
        body: HomePage(),
      ),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: <Widget>[
        Column(
          children: <Widget>[
//           占位图
//          1.占位图fadeinImage
//          2.图片缓存：1000张 100M imageCache
            FadeInImage.assetNetwork(
              placeholder: "assets/images/3.0x/logo.png",
              image:
              "https://upload-images.jianshu.io/upload_images/987457-a7b2feec26e900d7.png?imageMogr2/auto-orient/strip|imageView2/2/w/594",
              fit: BoxFit.cover,
            ),
            Image(
              image: NetworkImage(
                  "http://cdn.cocimg.com/bbs/attachment/upload/42/4989421574159993.png"),
              width: 150,
              height: 150,
              color: Colors.green,
              colorBlendMode: BlendMode.color,
//      fit: BoxFit.cover,
              repeat: ImageRepeat.repeat,
//      范围是 -1到1
              alignment: Alignment(0, 1),
            ),
            Image.asset(
              "assets/images/3.0x/logo.png",
            ),
          ],
        )
      ],
    );
  }
}
